<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:p="http://primefaces.org/ui">

    <body>

        <ui:composition template="./MainTemplate.xhtml">
            <ui:define name="head">
                <script type="text/javascript">
                    ( function($) {
                        // Make tab item 'advertise' on menu is active
                        $(document).ready( function() { $('#advertise').addClass("active"); });
                    }) ( jQuery );
                </script>
            </ui:define>

            <ui:define name="title">
                Advertise Page
            </ui:define>

            <ui:define name="left">
                <h:form>
                    <h1 class="title">Advertisement Request</h1>
                    <h4 style="text-align: justify">RadioCabs Company from all over VietNam can advertise with us. If you are interested to get Business Online. Please sent advertisement request to Team1 RadioCabs.</h4>
                    <h:panelGrid columns="3" id="panel" cellpadding="5">
                        <h:outputLabel value="Company name:" style="font-weight: bold;"></h:outputLabel>
                        <p:inputText id="name" value="#{advertiseBean.name}" 
                                     required="true" requiredMessage="Please input name"></p:inputText>
                        <p:message for="name"></p:message>

                        <h:outputLabel value="Designation:" style="font-weight: bold;"></h:outputLabel>
                        <p:inputText id="designation" value="#{advertiseBean.designation}" 
                                     required="true" requiredMessage="Please input designation"></p:inputText>
                        <p:message for="designation"></p:message>

                        <h:outputLabel value="Company address:" style="font-weight: bold;margin-right: 30px;"></h:outputLabel>
                        <p:inputTextarea id="address" value="#{advertiseBean.address}" 
                                         required="true" requiredMessage="Please input address"></p:inputTextarea>
                        <p:message for="address"></p:message>

                        <h:outputLabel value="Mobile no:" style="font-weight: bold;"></h:outputLabel>
                        <p:inputText id="no" value="#{advertiseBean.mobile}" 
                                     required="true" requiredMessage="Please input mobile no" maxlength="11" ></p:inputText>
                        <p:message for="no"></p:message>

                        <h:outputLabel value="Telephone:" style="font-weight: bold;"></h:outputLabel>
                        <p:inputText id="telephone" value="#{advertiseBean.telephone}" 
                                     required="true" requiredMessage="Please input telephone"></p:inputText>
                        <p:message for="telephone"></p:message>

                        <h:outputLabel value="Fax:" style="font-weight: bold;"></h:outputLabel>
                        <p:inputText id="fax" value="#{advertiseBean.fax}" 
                                     required="true" requiredMessage="Please input fax"></p:inputText>
                        <p:message for="fax"></p:message>

                        <h:outputLabel value="Email:" style="font-weight: bold;"></h:outputLabel>
                        <p:inputText id="email" value="#{advertiseBean.email}" 
                                     required="true" requiredMessage="Please input valid email"></p:inputText>
                        <p:message for="email"></p:message>

                        <h:outputLabel value="Description:" style="font-weight: bold;"></h:outputLabel>
                        <p:inputTextarea id="description" value="#{advertiseBean.description}" 
                                         required="true" requiredMessage="Please input description"></p:inputTextarea>
                        <p:message for="description"></p:message>

                        <h:outputLabel value="Payment Type:" style="font-weight: bold;"/>
                        <h:selectOneMenu id="paymenttype" value="#{paymentBean.paymentType}">
                            <f:selectItem itemValue="Cash" itemLabel="Cash"></f:selectItem>
                            <f:selectItem itemValue="Bank" itemLabel="Bank"></f:selectItem>
                        </h:selectOneMenu>
                        &nbsp;

                        <h:outputLabel value="Extension Day:" style="font-weight: bold;"/>
                        <p:inputText id="amount" value="#{paymentBean.amount}" required="true" requiredMessage="Please insert extension day!"/>
                        <h:selectOneMenu id="extensionday" value="#{paymentBean.extensionType}">
                            <f:selectItem itemValue="Monthly" itemLabel="Monthly"></f:selectItem>
                            <f:selectItem itemValue="Quaterly" itemLabel="Quaterly"></f:selectItem>
                        </h:selectOneMenu>
                        &nbsp;
                    </h:panelGrid>

                    <p:commandButton value="Submit" action="#{advertiseController.processRegister}" ajax="false"></p:commandButton>&nbsp;
                    <p:commandButton value="Reset" type="reset"></p:commandButton>
                </h:form>
            </ui:define>

            <ui:define name="right">
            </ui:define>

        </ui:composition>

    </body>
</html>
